const koa = require('koa');
const ejs = require('koa-ejs');
const pathlib = require('path');

let server = new koa();
server.listen(8080);

ejs(server, {
    root: pathlib.resolve('./ejs'),
    layout: false,
    viewExt: 'html',
})

server.use(async (ctx) => {
    await ctx.render('1', {name: 'tim', age: 30});
})